package test;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.function.CustomScoreProvider;
import org.apache.lucene.search.function.CustomScoreQuery;

@SuppressWarnings("serial")
public class CirCustomScoreQuery extends CustomScoreQuery {
	
	private float ALPHA;
	private float cenx;
	private float ceny;
	private float radi;
	private float ds;
	private List<String> terms = new ArrayList<String>();
	private List<Document> cirDocs = new ArrayList<Document>();
	private HashMap<String, Integer> hm = new HashMap<String, Integer>();

	public CirCustomScoreQuery(Query subQuery, float ALPHA, float cenx, float ceny, float radi, 
			float ds, List<String> terms, List<Document> cirDocs, HashMap<String, Integer> hm) {
		super(subQuery);
		// TODO Auto-generated constructor stub
		this.ALPHA = ALPHA;
		this.cenx = cenx;
		this.ceny = ceny;
		this.radi = radi;
		this.ds = ds;
		this.terms = terms;
		this.cirDocs = cirDocs;
		this.hm = hm;
	}

	@Override
	protected CustomScoreProvider getCustomScoreProvider(IndexReader reader)
			throws IOException {
		// TODO Auto-generated method stub
		return new CirCustomScoreProvider(reader, ALPHA, cenx, ceny, radi, ds, terms, cirDocs, hm);		
	}
}
